#include <stdio.h>
#include <stdlib.h>
#include "../../liboctopus/src/octopus.h"

struct octopus_context octopus;

void error(void) {
  printf("%s\n", octopus.error_str);
  exit(1);
}

int main()
{
  char s[20];
  int i;

  if(octopus_init (&octopus) <= 0)
    error();

  if(octopus_init(&octopus) <= 0)
    error();

  if(octopus_open(&octopus) <= 0)
    error();

  printf("init...\n");
  i = octopus_can_init(&octopus, 3, 1);
  if(i <= 0)
  {
    printf("init: %d\n", i);
    exit(0);
  }

s[0] = 'h';
s[1] = 'i';
s[2] = ' ';
s[3] = 't';
s[4] = 'h';
s[5] = 'e';
s[6] = 'r';
s[7] = 'e';

  printf("enable_mob...\n");
  i = octopus_can_enable_mob(&octopus, 1, 4, 3, 0xffffffff);
  if(i <= 0)
  {
    printf("enable_mob: %d\n", i);
    exit(0);
  }

  octopus_can_set_autoreply(&octopus, 1, 3, "autoreply");
  if(i <= 0)
  {
    printf("set_autoreply: %d\n", i);
    exit(0);
  }
  
  return 0;
}
